package com.soulkun.smarthome.ui.main.personal.viewmodel

import androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.ViewModel
import com.soulkun.smarthome.logic.model.ResponseModel
import com.soulkun.smarthome.logic.repository.ApiRepository

class AppMainPersonalRenameViewModel : ViewModel() {

    val nicknameEditLiveData = MutableLiveData<String>("")
    var renameString: String?= null

    fun rename(): LiveData<Result<ResponseModel<Any>>> {
        renameString = nicknameEditLiveData.value ?: ""
        return ApiRepository.fillUserInfo(nicknameEditLiveData.value ?: "")
    }

}